package com.lanchetech.dao;
import java.util.Date;

import com.lanchetech.bean.request.PageReq;
import com.lanchetech.bean.vo.MerchantVO;
import com.lanchetech.entity.Merchant;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface MerchantMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Merchant record);

    int insert2(Merchant record);

    int register(Merchant record);

    int insertSelective(Merchant record);

    Merchant selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Merchant record);

    int updateByPrimaryKey(Merchant record);

    Merchant findOneByUsername(@Param("username") String username);

    Merchant getOneByUsername(@Param("username") String username);

    List<MerchantVO> findAll();

    List<Merchant> findAllPage(PageReq req);

    int updateTenantIdAndRoleIdByIdAndTenantId(@Param("updatedTenantId")Long updatedTenantId,@Param("updatedRoleId")Long updatedRoleId,@Param("id")Long id,@Param("tenantId")Long tenantId);

    int updateLastPasswordResetDateByTenantId(@Param("updatedLastPasswordResetDate")Date updatedLastPasswordResetDate,@Param("tenantId")Long tenantId);


    int updatePasswordAndLastPasswordResetDateById(@Param("updatedPassword")String updatedPassword,@Param("updatedLastPasswordResetDate")Date updatedLastPasswordResetDate,@Param("id")Long id);

}